const mysql = require("mysql");
module.exports = {
  config: {
    host: "localhost",
    port: "3306",
    user: "root",
    password: "root123",
    database: "admin",
  },
  // 连接数据库
  sqlConnect: function (sql, sqlArr, callBack) {
    var pool = mysql.createPool(this.config);
    pool.getConnection((err, conn) => {
      console.log("123");
      if (err) {
        console.log(err);
        return;
      }
      conn.query(sql, sqlArr, callBack);
      conn.release();
    });
  },
};
